package com.itobase.statusDetect.Util;

import java.util.*;

/**
 * @author htyu
 * @date 2019/5/9
 */
public class ListUtil {

    public static List removeDuplicateWithOrder(List list) {
        Set set = new HashSet();
        List newList = new ArrayList();
        for (Iterator iter = list.iterator(); iter.hasNext();) {
            Object element = iter.next();
            if (set.add(element))
                newList.add(element);
        }
        list.clear();
        list.addAll(newList);
        return newList;
    }
}
